package ro.cityprojects.adminloc.entities;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import java.sql.Timestamp;

/**
 * Consumption class
 *
 * @author bogdan.solga
 *
 * Date: 13.06.2013, time: 17:47
 */
@Entity
public class Consumption {

    @Id
    @javax.persistence.Column(name = "CONSUMPTION_ID", nullable = false, insertable = true, updatable = true, length = 0, precision = -127)
    private Integer consumptionId;

    public Integer getConsumptionId() {
        return consumptionId;
    }

    public void setConsumptionId(Integer consumptionId) {
        this.consumptionId = consumptionId;
    }

    @javax.persistence.Column(name = "START_DATE", nullable = false, insertable = true, updatable = true, length = 7, precision = 0)
    private Timestamp startDate;

    public Timestamp getStartDate() {
        return startDate;
    }

    public void setStartDate(Timestamp startDate) {
        this.startDate = startDate;
    }

    @javax.persistence.Column(name = "END_DATE", nullable = false, insertable = true, updatable = true, length = 7, precision = 0)
    private Timestamp endDate;

    public Timestamp getEndDate() {
        return endDate;
    }

    public void setEndDate(Timestamp endDate) {
        this.endDate = endDate;
    }

    @javax.persistence.Column(name = "STATE", nullable = false, insertable = true, updatable = true, length = 0, precision = -127)
    private Integer state;

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @ManyToOne
    @javax.persistence.JoinColumn(name = "EXPENSE_TYPE", referencedColumnName = "EXPENSE_TYPE_ID", nullable = false)
    private ExpenseTypes expenseTypesByExpenseType;

    public ExpenseTypes getExpenseTypesByExpenseType() {
        return expenseTypesByExpenseType;
    }

    public void setExpenseTypesByExpenseType(ExpenseTypes expenseTypesByExpenseType) {
        this.expenseTypesByExpenseType = expenseTypesByExpenseType;
    }
}
